'use strict';function _Xf(c,v,l){function t(a){for(var f=1;a+"_"+f in c;++f);return a+"_"+f}function u(a,f,d){for(let w of a)try{{var b=w;a=f;var e=d;let h=[],x=0;for(let k of b){e=!x++&&e||"."==k[0];q||(q=k);let p=c[k];if(_Mg(p)){let g=u(p,a,e);a=g.str;if(l[k]){let m=l[k]();for(let y of g.nodes)m.addChild(y);h.push(m)}else h.push(...g.nodes)}else{let g=c.blank&&!e?[p,c.blank,p]:[p];for(b=0;b<g.length;++b){let m=g[b]instanceof RegExp?a.match(g[b]):a.startsWith(g[b])?[g[b]]:null;if(!m){if(!b&&1<g.length)continue;
throw 1;}a=a.substr(m[0].length);if(1!=b){a.length<r&&(r=a.length,q=null);l[k]&&h.push(l[k](m[0]));break}}}}var n={str:a,nodes:h}}return n}catch(h){h instanceof Error&&console.error(h)}throw 1;}c=Object.assign({},c);l=Object.assign({},l);for(let a=2;a--;)for(let f in c){let d=c[f];if("string"==typeof d){d=d.replace(/(["'])((?!\1)[^\\]|\\.)*\1/g,b=>{let e=t(f);c[e]=[b.slice(1,-1)];return e});do{var z=d;d=d.replace(/\([^()]+\)/g,b=>{let e=t(f);c[e]=b.slice(1,-1);return e})}while(z!=d);d=d.replace(/\b([\w]+)\s*([*+?])/g,
(b,e,n)=>{b=e+("+"==n?"*":n);c[b]=e+("?"==n?"":" "+b)+" | empty";return("+"==n?e+" ":"")+b});d=d.replace(/\.\s*([\w?*]+)/g,(b,e)=>{b="."+e;c[b]=e;return" "+b});c[f]=d}}for(let a in c)c[a]="string"==typeof c[a]?c[a].trim().split("|").map(f=>f.trim().split(/\s+/)):c[a]instanceof RegExp?RegExp("^(?:"+c[a].source+")",c[a].flags):c[a][0];c.empty=/^/;let q,r=Infinity;return a=>{try{return u([[v]],a)}catch(f){let d=a.length-Math.min(r,a.length+1)+1;throw"Syntax error at position "+d+". Expecting: "+q.match(/^\w+/)[0]+
"\n"+Array(Math.min(d,30)).join(" ")+"v\n"+a.substr(Math.max(0,d-30),60);}}};
